import Vue from 'vue'
import VueRouter from 'vue-router'

import Login from '@/views/login'

// 后台首页骨架
import Layout from '@/layout'
// 后台首页内容
import Dashboard from '@/views/dashboard'
import Detail from '@/views/dashboard/detail'


import Department from '@/views/department'


Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    { path: '/', redirect: '/login' },
    { path: '/login', component: Login },
    {
      path: '/dashboard',
      component: Layout,
      children: [
        // 默认加载
        { path: '', component: Dashboard },
        //  其它页面
        { path: '/dashboard/detail/:id', component: Detail },

      ]
    },
    {
      path: '/department',
      component: Layout,
      children: [
        { path: '/department', component: Department },
      ]
    }

  ]
})

export default router